package chapter06

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/5 19:48
  * @history:
  *          1.2019/1/5 created by chuhaitao
  */
object ExceptionDemo {

  def main(args: Array[String]): Unit = {

    // var dog=new Dog
    //不能赋值
    // println( dog.age)
    // println( dog.name)
    var res = 1L
    var f = (char: Char) => {
      res *= char.toLong
    }

    "Hello".foreach((char: Char) => {
      res *= char.toLong
    })
    "Hello".foreach(res *= _.toLong)

  }
}


class Dog {
  //必须指定类型，否则不能赋值
  var age: Int = _

  var name: String = _

}